package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IWorkerBankAccountMsgService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/worker/bank-account")
@Api(tags = "APP端 - 银行账号相关接口")
public class WorkerBankAccountMsgController {
    @Resource
    private IWorkerBankAccountMsgService iWorkerBankAccountMsgService;
    @PostMapping()
    @ApiOperation("新增或者更新银行账号信息")
    public BankAccountResDTO addOrUpdateBankMsg(@RequestBody BankAccountUpsertReqDTO dto){
        return iWorkerBankAccountMsgService.addOrUpdateBankMsg(dto);
    }
    @GetMapping("/currentUserBankAccount")
    @ApiOperation("获取当前用户银行账号信息")
    public BankAccountResDTO getBankMsgById(){
        return iWorkerBankAccountMsgService.getBankMsgById();
    }
}
